import axios from 'axios';

export function post(url, authtoken) {
	axios.defaults.headers['authtoken'] = authtoken;
	return axios.post(url)
}
export function postJson(url, data, authtoken) {
	axios.defaults.headers['authtoken'] = authtoken;
	return axios({
		url:url,
		method:"POST",
		data:JSON.stringify(data),
		headers:{
			'authtoken':authtoken,
			'Content-Type': 'application/json'
		}
	})
	// axios.post()
}
export function get(url, authtoken) {
	// axios.defaults.withCredentials=true
	axios.defaults.headers['authtoken'] = authtoken;
	return axios.get(url)
}
